home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / pageitem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-12-11  |  43.2 KB  |  1,325 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                           pageitem.h  -  description
  9.                              -------------------
  10.     begin                : Sat Apr 7 2001
  11.     copyright            : (C) 2001 by Franz Schmid
  12.     email                : Franz.Schmid@altmuehlnet.de
  13.  ***************************************************************************/
  14.  
  15. /***************************************************************************
  16.  *                                                                         *
  17.  *   This program is free software; you can redistribute it and/or modify  *
  18.  *   it under the terms of the GNU General Public License as published by  *
  19.  *   the Free Software Foundation; either version 2 of the License, or     *
  20.  *   (at your option) any later version.                                   *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23.  
  24. #ifndef PAGEITEM_H
  25. #define PAGEITEM_H
  26.  
  27. #include <QObject>
  28. #include <QWidget>
  29. #include <QPolygon>
  30. #include <QStack>
  31. #include <QList>
  32. #include <QKeyEvent>
  33. #include <QMenu>
  34. #include <QRect>
  35. #include <QRectF>
  36. #include <QVector>
  37. #include <QTemporaryFile>
  38.  
  39. #include "scribusapi.h"
  40. #include "annotation.h"
  41. #include "observable.h"
  42. #include "pagestructs.h"
  43. #include "scimage.h"
  44. #include "sctextstruct.h"
  45. #include "undoobject.h"
  46. #include "vgradient.h"
  47. #include "text/nlsconfig.h"
  48. #include "text/storytext.h"
  49. #include "desaxe/saxio.h"
  50.  
  51. class ScPainter;
  52. class ScribusDoc;
  53. class SimpleState;
  54. class UndoManager;
  55. class UndoState;
  56. class ResourceCollection;
  57. class QFrame;
  58. class QGridLayout;
  59.  
  60. class PageItem_ImageFrame;
  61. class PageItem_Line;
  62. class PageItem_Polygon;
  63. class PageItem_PolyLine;
  64. class PageItem_TextFrame;
  65. class PageItem_PathText;
  66. class PageItem_LatexFrame;
  67.  
  68. struct CopyPasteBuffer;
  69. /**
  70.   *@author Franz Schmid
  71.   */
  72.  
  73. class SCRIBUS_API PageItem : public QObject, public UndoObject, public SaxIO, public SingleObservable<PageItem>
  74. {
  75.     Q_OBJECT
  76.  
  77.     // Properties - see http://doc.trolltech.com/3.3/properties.html
  78.     // See the accessors of these properties for details on their use.
  79.     Q_PROPERTY(QString itemName READ itemName WRITE setItemName DESIGNABLE false)
  80.     Q_PROPERTY(QString fillColor READ fillColor WRITE setFillColor DESIGNABLE false)
  81.     Q_PROPERTY(QString lineColor READ lineColor WRITE setLineColor DESIGNABLE false)
  82.     Q_PROPERTY(double fillShade READ fillShade WRITE setFillShade DESIGNABLE false)
  83.     Q_PROPERTY(double lineShade READ lineShade WRITE setLineShade DESIGNABLE false)
  84.     Q_PROPERTY(double fillTransparency READ fillTransparency WRITE setFillTransparency DESIGNABLE false)
  85.     Q_PROPERTY(double lineTransparency READ lineTransparency WRITE setLineTransparency DESIGNABLE false)
  86.     Q_PROPERTY(bool m_Locked READ locked WRITE setLocked DESIGNABLE false)
  87.     Q_PROPERTY(bool m_SizeLocked READ sizeLocked WRITE setSizeLocked DESIGNABLE false)
  88.     Q_PROPERTY(bool m_ImageIsFlippedV READ imageFlippedV WRITE setImageFlippedV DESIGNABLE false)
  89.     Q_PROPERTY(bool m_ImageIsFlippedH READ imageFlippedH WRITE setImageFlippedH DESIGNABLE false)
  90.     Q_PROPERTY(double lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE false)
  91.     Q_PROPERTY(QString customLineStyle READ customLineStyle WRITE setCustomLineStyle DESIGNABLE false)
  92.     Q_PROPERTY(int startArrowIndex READ startArrowIndex WRITE setStartArrowIndex DESIGNABLE false)
  93.     Q_PROPERTY(int endArrowIndex READ endArrowIndex WRITE setEndArrowIndex DESIGNABLE false)
  94.  
  95.     Q_PROPERTY(bool m_PrintEnabled READ printEnabled WRITE setPrintEnabled DESIGNABLE false)
  96.     Q_PROPERTY(double xPos READ xPos WRITE setXPos DESIGNABLE false)
  97.     Q_PROPERTY(double yPos READ yPos WRITE setYPos DESIGNABLE false)
  98.     Q_PROPERTY(double width READ width WRITE setWidth DESIGNABLE false)
  99.     Q_PROPERTY(double height READ height WRITE setHeight DESIGNABLE false)
  100.     Q_PROPERTY(double rotation READ rotation WRITE setRotation DESIGNABLE false)
  101.     Q_PROPERTY(double imageXScale READ imageXScale WRITE setImageXScale DESIGNABLE false)
  102.     Q_PROPERTY(double imageYScale READ imageYScale WRITE setImageYScale DESIGNABLE false)
  103.     Q_PROPERTY(double imageXOffset READ imageXOffset WRITE setImageXOffset DESIGNABLE false)
  104.     Q_PROPERTY(double imageYOffset READ imageYOffset WRITE setImageYOffset DESIGNABLE false)
  105.     Q_PROPERTY(bool reversed READ reversed WRITE setReversed DESIGNABLE false)
  106.     Q_PROPERTY(double cornerRadius READ cornerRadius WRITE setCornerRadius DESIGNABLE false)
  107.     Q_PROPERTY(double textToFrameDistLeft READ textToFrameDistLeft WRITE setTextToFrameDistLeft DESIGNABLE false)
  108.     Q_PROPERTY(double textToFrameDistRight READ textToFrameDistRight WRITE setTextToFrameDistRight DESIGNABLE false)
  109.     Q_PROPERTY(double textToFrameDistTop READ textToFrameDistTop WRITE setTextToFrameDistTop DESIGNABLE false)
  110.     Q_PROPERTY(double textToFrameDistBottom READ textToFrameDistBottom WRITE setTextToFrameDistBottom DESIGNABLE false)
  111.     Q_PROPERTY(double ColGap READ columnGap WRITE setColumnGap DESIGNABLE false)
  112.     Q_PROPERTY(int Cols READ columns WRITE setColumns DESIGNABLE false)
  113.     Q_ENUMS(FirstLineOffsetPolicy)
  114.     Q_PROPERTY(FirstLineOffsetPolicy firstLineOffset READ firstLineOffset WRITE setFirstLineOffset DESIGNABLE false)
  115.     // FIXME: QMetaProperty can't translate these to/from enumerator names, probably because the
  116.     // properties aren't moc'd in the Qt sources. They work fine in their
  117.     // current state as plain integer properties.
  118. //      Q_ENUMS(PenStyle)
  119. //     Q_PROPERTY(PenStyle lineStyle READ lineStyle WRITE setLineStyle DESIGNABLE false)
  120. //     Q_ENUMS(PenCapStyle)
  121. //     Q_PROPERTY(PenCapStyle lineEnd READ lineEnd WRITE setLineEnd DESIGNABLE false)
  122. //     Q_ENUMS(PenJoinStyle)
  123. //     Q_PROPERTY(PenJoinStyle lineJoin READ lineJoin WRITE setLineJoin DESIGNABLE false)
  124.  
  125.     // This property may not hang around for too long, but should be useful
  126.     // when testing out the pageitem refactoring work.  Setting it is unlikely
  127.     // to currently have the desired effect.
  128.     /**
  129.      * @brief Item type.
  130.      * @warning Do not set this property except for testing and debug purposes.
  131.      */
  132.     Q_ENUMS(ItemType)
  133.     Q_PROPERTY(ItemType itemType READ itemType WRITE convertTo DESIGNABLE false)
  134.  
  135. public:
  136.     // Enumerator definitions
  137.  
  138.     /** @brief Item Type
  139.      *
  140.      * Soon, item type will probably go away in favour of using
  141.      * subclasses and checking types using more conventional methods
  142.      * and using Qt's MetaObject introspection.
  143.      * Multiple is used for checking in @sa Selection for all same type of items
  144.      */
  145.     enum ItemType {
  146.         ItemType1    = 1,
  147.         ImageFrame    = 2,
  148.         ItemType3    = 3,
  149.         TextFrame    = 4,
  150.         Line        = 5,
  151.         Polygon        = 6,
  152.         PolyLine    = 7,
  153.         PathText    = 8,
  154.         LatexFrame  = 9,
  155.         Multiple    = 99
  156.     };
  157.  
  158.     /** @brief Text flow mode
  159.      *
  160.      * Describe if and how text flow around object
  161.      */
  162.     enum TextFlowMode {
  163.         TextFlowDisabled = 0,
  164.         TextFlowUsesFrameShape  = 1,
  165.         TextFlowUsesBoundingBox = 2,
  166.         TextFlowUsesContourLine = 3,
  167.         TextFlowUsesImageClipping = 4
  168.     };
  169.  
  170.     /* these do essentially the same as a dynamic cast but might be more readable */
  171.     virtual PageItem_ImageFrame * asImageFrame() { return NULL; }
  172.     virtual PageItem_Line * asLine() { return NULL; }
  173.     virtual PageItem_PathText * asPathText() { return NULL; }
  174.     virtual PageItem_Polygon * asPolygon() { return NULL; }
  175.     virtual PageItem_PolyLine * asPolyLine() { return NULL; }
  176.     virtual PageItem_TextFrame * asTextFrame() { return NULL; }
  177.     virtual PageItem_LatexFrame * asLatexFrame() { return NULL; }
  178.  
  179.  
  180.     /** @brief Frame Type
  181.      *
  182.      * 
  183.      */
  184.     enum ItemFrameType {
  185.         Unspecified =-1,
  186.         Rectangle    = 0,
  187.         Ellipse        = 1,
  188.         Round        = 2,
  189.         Other        = 3
  190.     };
  191.  
  192. protected:
  193.     PageItem(const PageItem & other);
  194.     
  195. public:
  196.     PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline);
  197.     ~PageItem()
  198.     {
  199.         if (tempImageFile != NULL)
  200.             delete tempImageFile;
  201.     }
  202.  
  203.     static const Xml_string saxxDefaultElem;
  204.     static void  desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
  205.     
  206.     virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const;
  207.     virtual void saxx(SaxHandler& handler)                     const { saxx(handler, saxxDefaultElem); }
  208.     
  209.     /**
  210.      * @brief Clear the contents of a frame.
  211.      * WARNING: Currently *they* do not check if the user wants this.
  212.      * The view does when these are called.
  213.      */    
  214.     virtual void clearContents() {};
  215.     
  216.     /**
  217.      * @brief Adjust the picture scale, moved from the view, no view code here
  218.      * FIXME: Move to PageItem_TextFrame
  219.      */
  220.     void AdjustPictScale();
  221.     
  222.     /**
  223.      * @brief Set or get the redraw bounding box of the item, moved from the View
  224.      */
  225.     QRect getRedrawBounding(const double);
  226.     void setRedrawBounding();
  227.             
  228.     /**
  229.      * @brief Update the gradient vectors, moved from the View
  230.      */        
  231.     void updateGradientVectors();
  232.     /**
  233.      * @brief Move the image within the frame
  234.      * Old ScribusView::MoveItemI
  235.      * @todo Move to PageItem_ImageFrame
  236.      */
  237.     void moveImageInFrame(double newX, double newY);
  238.  
  239.     ObjAttrVector* getObjectAttributes();
  240.     /*!
  241.      * brief Returns a complete ObjectAttribute struct if 1 is found, or ObjectAttribute.name will be QString::null if 0 or >1 are found
  242.      */
  243.     ObjectAttribute getObjectAttribute(QString) const;
  244.     void setObjectAttributes(ObjAttrVector*);
  245.     
  246.     virtual bool createInfoGroup(QFrame *, QGridLayout *) {return false;}
  247. //    virtual bool createContextMenu(QMenu *, int step) {return false;}
  248.     
  249.   /** Zeichnet das Item */
  250.     void paintObj(QPainter *p);
  251.     void DrawObj(ScPainter *p, QRectF e);
  252.     void DrawObj_Pre(ScPainter *p, double &sc);
  253.     virtual void DrawObj_Post(ScPainter *p);
  254.     virtual void DrawObj_Item(ScPainter *p, QRectF e, double sc) = 0;
  255.     QImage DrawObj_toImage();
  256.     QImage DrawObj_toImage(QList<PageItem*> &emG);
  257.     
  258.     virtual void applicableActions(QStringList& actionList) = 0;
  259.     virtual QString infoDescription();
  260.             
  261. protected:
  262.     void DrawObj_ImageFrame(ScPainter *p, double sc);
  263.     //void DrawObj_TextFrame(ScPainter *p, QRectF e, double sc);
  264.     //void DrawObj_Line(ScPainter *p);
  265.     void DrawObj_Polygon(ScPainter *p);
  266.     void DrawObj_PolyLine(ScPainter *p);
  267.     void DrawObj_PathText(ScPainter *p, double sc);
  268. public:
  269.     void DrawObj_Embedded(ScPainter *p, QRectF e, const CharStyle& style, PageItem* cembedded);
  270.     void SetFrameShape(int count, double *vals);
  271.     void SetRectFrame();
  272.     void SetOvalFrame();
  273.     void SetFrameRound();
  274.     void setPolyClip(int up, int down = 0);
  275.     void updatePolyClip();
  276.     void updateClip();
  277.     void convertClip();
  278.     //QRect getRedrawBounding(const double);
  279.     //void setRedrawBounding();
  280.     void getBoundingRect(double *x1, double *y1, double *x2, double *y2) const;
  281.     void getVisualBoundingRect(double *x1, double *y1, double *x2, double *y2) const;
  282.     QRectF getBoundingRect() const;
  283.     QRectF getVisualBoundingRect() const;
  284.     void getTransform(QMatrix& mat) const;
  285.     QMatrix getTransform() const;
  286.     /**
  287.      * @brief Check if a QPoint is within the items boundaries
  288.      * No coordinates transformation is performed
  289.      * @param x X position
  290.         @param y Y position
  291.      * @return bool true if x, i in the item
  292.      */
  293.     bool pointWithinItem(const int x, const int y) const;
  294.     /**
  295.      * @brief Check if the mouse is within the items boundaries
  296.      * This method performs necessary page to device transformations
  297.         @param x X position
  298.         @param y Y position
  299.         @param scale scale of the vport
  300.      * @return bool true if the x, y is in the bounds 
  301.      */
  302.     bool mouseWithinItem(const int x, const int y, double scale) const;
  303.     void copyToCopyPasteBuffer(struct CopyPasteBuffer *Buffer);
  304.     
  305.     virtual void handleModeEditKey(QKeyEvent *k, bool &keyRepeat);
  306.     
  307.     /// invalidates current layout information
  308.     virtual void invalidateLayout() { invalid = true; }
  309.     /// creates valid layout information
  310.     virtual void layout() {}
  311.     /// returns true if text overflows
  312.     bool frameOverflows() const;
  313.     /// returns index of first char displayed in this frame, used to be 0
  314.     int firstInFrame() const;
  315.     /// returns index of last char displayed in this frame, used to be MaxChars-1
  316.     int lastInFrame() const;
  317.     /// tests if a character is displayed by this frame
  318.     bool frameDisplays(int textpos) const;
  319.     /// returns the style at the current charpos
  320.     const ParagraphStyle& currentStyle() const;
  321.     /// returns the style at the current charpos
  322.     ParagraphStyle& changeCurrentStyle();
  323.     /// returns the style at the current charpos
  324.     const CharStyle& currentCharStyle() const;
  325.     // deprecated:
  326.     double layoutGlyphs(const CharStyle& style, const QString& chars, GlyphLayout& layout);
  327.     void SetQColor(QColor *tmp, QString farbe, double shad);
  328.     void drawGlyphs(ScPainter *p, const CharStyle& style, GlyphLayout& glyphs );
  329.     void DrawPolyL(QPainter *p, QPolygon pts);
  330.     QString ExpandToken(uint base);
  331.     
  332.     bool AutoName;    
  333.     double gXpos;
  334.     double gYpos;
  335.     double gWidth;
  336.     double gHeight;
  337.     int GrType;
  338.     double GrStartX;
  339.     double GrStartY;
  340.     double GrEndX;
  341.     double GrEndY;
  342.     int Cols;
  343.     double ColGap;
  344.     double gridOffset_;
  345.     double gridValue_;
  346.  
  347.     /** Linestyle */
  348.     Qt::PenStyle PLineArt;
  349.     Qt::PenCapStyle PLineEnd;
  350.     Qt::PenJoinStyle PLineJoin;
  351.     QString NamedLStyle;
  352.   /** Defines clipping region of the elements; */
  353.     QPolygon Clip;
  354.     
  355.     FPointArray PoLine;
  356.     const FPointArray shape() const { return PoLine; }
  357.     void setShape(FPointArray val) { PoLine = val; }
  358.     
  359.     FPointArray ContourLine;
  360.     const FPointArray contour() const { return ContourLine; }
  361.     void setContour(FPointArray val) { ContourLine = val; }
  362.     
  363.     FPointArray imageClip;
  364.     QList<uint> Segments;
  365.     ScImageEffectList effectsInUse;
  366.     bool PoShow;
  367.     double BaseOffs;
  368.     int textPathType;
  369.     bool textPathFlipped;
  370.     bool flipPathText() const { return textPathFlipped; }
  371.     void setFlipPathText(bool val) { textPathFlipped = val; }
  372.     int pathTextType() const { return textPathType; }
  373.     void setPathTextType(int val) { textPathType = val; }
  374.     double pathTextBaseOffset() const { return BaseOffs; }
  375.     void setPathTextBaseOffset(double val) { BaseOffs = val; }
  376.     bool pathTextShowFrame() const { return PoShow; }
  377.     void setPathTextShowFrame(bool val) { PoShow = val; }
  378.     
  379.     bool useEmbeddedImageProfile() const { return UseEmbedded; }
  380.     void setUseEmbeddedImageProfile(bool val) { UseEmbedded = val; }
  381.     QString embeddedImageProfile() const { return EmProfile; }
  382.     void setEmbeddedImageProfile(QString val) { EmProfile = val; }
  383.  
  384.     
  385.     bool ClipEdited;
  386.     // Don't know exactly what this is, but it's not the same as itemType
  387.     int FrameType;
  388.   /** Interne Item-Nummer */
  389.     uint ItemNr;
  390.   /** Internal unique Item-Number, used for the undo system */
  391.     uint uniqueNr;
  392.   /** Hat Element Rahmen? FIXME: still used? - in DrawObject_Post */
  393.     bool Frame;
  394.   /** page this element belongs to */
  395.     int OwnPage;
  396.     /** @brief Old page number tracked for the move undo action */
  397.     int oldOwnPage;
  398.     int savedOwnPage;
  399.   /** Darzustellendes Bild */
  400.     ScImage pixm;
  401.   /** Dateiname des Bildes */
  402.     QString Pfile;
  403.     QString Pfile2;
  404.     QString Pfile3;
  405.     QString externalFile() const { return Pfile; }
  406.     void setExternalFile(QString val);
  407.     void setImagePagenumber(int num) { pixm.imgInfo.actualPageNumber = num; }
  408.     
  409.     //FIXME: maybe these should go into annotation?
  410.     QString fileIconPressed() const { return Pfile2; }
  411.     void setFileIconPressed(QString val);
  412.     QString fileIconRollover() const { return Pfile3; }
  413.     void setFileIconRollover(QString val);
  414.     
  415.     QString IProfile;
  416.     bool UseEmbedded;
  417.     QString EmProfile;
  418.     int IRender;
  419.     // some accessor methods:
  420.     int cmsRenderingIntent() const { return IRender; }
  421.     void setCmsRenderingIntent(int val) { IRender = val; }
  422.     QString cmsProfile() const { return IProfile; }
  423.     void setCmsProfile(QString val) { IProfile = val; }
  424.     
  425.     /*! Flag to hiold image file availability */
  426.     bool PictureIsAvailable;
  427.     int OrigW;
  428.     int OrigH;
  429.   /** BoundigBox-X */
  430.     double BBoxX;
  431.   /** BoundingBox-H */
  432.     double BBoxH;
  433.   /** Zeichen X-Position */
  434.     double CurX;
  435.   /** Zeichen Y-Position */
  436.     double CurY;
  437.   /** Cursorposition */
  438.     int CPos;
  439.   /** Text des Elements */
  440.     StoryText itemText;
  441.   /** Flag fuer PDF-Bookmark */
  442.     bool isBookmark;
  443.   /** Flag for redraw in EditMode */
  444.     bool Dirty;
  445.     /** Flag indicates that layout has changed (eg. for textlayout) */
  446.     bool invalid;
  447.   /** Flag fuer Auswahl */
  448.     bool HasSel;
  449.     /** avoid artefacts while moving */
  450.     bool FrameOnly;
  451.     bool isAutoText;
  452.     PageItem* prevInChain() { return BackBox; }
  453.     PageItem* nextInChain() { return NextBox; }
  454.     const PageItem* prevInChain() const { return BackBox; }
  455.     const PageItem* nextInChain() const { return NextBox; }
  456.     void unlink();
  457.     void link(PageItem* nextFrame);
  458.     void dropLinks();
  459.  
  460. protected:
  461.     PageItem *BackBox;
  462.     PageItem *NextBox;
  463.     uint firstChar;
  464.     uint MaxChars;
  465. public:
  466.     bool inPdfArticle;
  467.     bool isRaster;
  468.     double OldB;
  469.     double OldH;
  470.     double OldB2;
  471.     double OldH2;
  472.     bool Sizing;
  473.     bool toPixmap;
  474.     int LayerNr;
  475.     bool ScaleType;
  476.     bool AspectRatio;
  477.     QStack<int> Groups;
  478.     const QStack<int>& groups() const { return Groups; }
  479.     QStack<int>& groups() { return Groups; }
  480.     void setGroups( QStack<int> val) { Groups = val; }
  481.     
  482.     bool controlsGroup() const { return isGroupControl; }
  483.     void setControlsGroup(bool val) { isGroupControl = val; }
  484.     
  485.     QVector<double> DashValues;
  486.     double DashOffset;
  487.     const QVector<double>& dashes() const { return DashValues; }
  488.     QVector<double>& dashes() { return DashValues; }
  489.     void setDashes(QVector<double> val) { DashValues = val; }
  490.     double dashOffset() const { return DashOffset; }
  491.     void setDashOffset(double val) { DashOffset = val; }
  492.     VGradient fill_gradient;
  493.     bool fillRule;
  494.     bool doOverprint;
  495. /* Additions for Table Support */
  496.     PageItem* LeftLink;
  497.     PageItem* RightLink;
  498.     PageItem* TopLink;
  499.     PageItem* BottomLink;
  500.     int LeftLinkID;
  501.     int RightLinkID;
  502.     int TopLinkID;
  503.     int BottomLinkID;
  504.     bool LeftLine;
  505.     bool RightLine;
  506.     bool TopLine;
  507.     bool BottomLine;
  508.     bool isTableItem;
  509.     void setIsTableItem(bool val) { isTableItem = val; }
  510.     void setHasLeftLine(bool val) { LeftLine = val; }
  511.     void setHasRightLine(bool val) { RightLine = val; }
  512.     void setHasTopLine(bool val) { TopLine = val; }
  513.     void setHasBottomLine(bool val) { BottomLine = val; }
  514.     void setLeftLink(PageItem* lnk) { LeftLink = lnk; }
  515.     void setRightLink(PageItem* lnk) { RightLink = lnk; }
  516.     void setTopLink(PageItem* lnk) { TopLink = lnk; }
  517.     void setBottomLink(PageItem* lnk) { BottomLink = lnk; }
  518.     bool isSingleSel;
  519.     bool isGroupControl;
  520.     PageItem *groupsLastItem;
  521.     void setGroupsLastItem(PageItem* item);
  522.     double BoundingX;
  523.     double BoundingY;
  524.     double BoundingW;
  525.     double BoundingH;
  526.     bool ChangedMasterItem;
  527.     QString OnMasterPage;
  528.     bool isEmbedded;
  529.     
  530.     //Position
  531.     double xPos() const { return Xpos; }
  532.     double yPos() const { return Ypos; }
  533.     double visualXPos() const;
  534.     double visualYPos() const;
  535.     FPoint xyPos() const { return FPoint(Xpos, Ypos); }
  536.     void setXPos(const double, bool drawingOnly=false);
  537.     void setYPos(const double, bool drawingOnly=false);
  538.     void setXYPos(const double, const double, bool drawingOnly=false);
  539.     void moveBy(const double, const double, bool drawingOnly=false);
  540.     //Size
  541.     double width() const { return Width; }
  542.     double height() const { return Height; }
  543.     double visualWidth() const;
  544.     double visualHeight() const;
  545.     void setWidth(const double);
  546.     void setHeight(const double);
  547.     void setWidthHeight(const double, const double, bool drawingOnly);
  548.     void setWidthHeight(const double, const double);
  549.     void resizeBy(const double, const double);
  550.     //Rotation
  551.     double rotation() const { return Rot; }
  552.     void setRotation(const double, bool drawingOnly);
  553.     void setRotation(const double r) { setRotation(r, false); }  // needed for deSaXe
  554.     void rotateBy(const double);
  555.     //Selection
  556.     bool isSelected() const { return Select; }
  557.     void setSelected(const bool);
  558.     //Image Data
  559.     double imageXScale() const { return LocalScX; }
  560.     double imageYScale() const { return LocalScY; }
  561.     void setImageXScale(const double);
  562.     void setImageYScale(const double);
  563.     void setImageXYScale(const double, const double);
  564.     double imageXOffset() const { return LocalX; }
  565.     double imageYOffset() const { return LocalY; }
  566.     void setImageXOffset(const double);
  567.     void setImageYOffset(const double);
  568.     void moveImageXYOffsetBy(const double, const double);
  569.     void setImageXYOffset(const double, const double);
  570.     //Reverse
  571.     bool reversed() const { return Reverse; }
  572.     void setReversed(bool);
  573.     //Rounded Corners
  574.     double cornerRadius() const { return RadRect; }
  575.     void setCornerRadius(double);
  576.     // PDF bookmark
  577.     bool isPDFBookmark() const { return isBookmark; }
  578.     void setIsPDFBookmark(bool val) { isBookmark = val; }
  579.     // 0=none, 1,2,3,4=linear, 5=radial, 6=free linear, 7=free radial, 8=pattern 
  580.     int gradientType() const { return GrType; }
  581.     void setGradientType(int val) { GrType = val; }
  582.     void gradientVector(double& startX, double& startY, double& endX, double& endY) const;
  583.     void setGradientVector(double startX, double startY, double endX, double endY);
  584.     // 
  585.     bool fillEvenOdd() const { return fillRule; }
  586.     void setFillEvenOdd(bool val) { fillRule = val; }
  587.     //
  588.     bool overprint() const { return doOverprint; }
  589.     void setOverprint(bool val) { doOverprint = val; }
  590.     // rect / oval / round / other
  591.     int frameType() const { return FrameType; }
  592.     void setFrameType(int val) { FrameType = val; }
  593.     //
  594.     bool hasDefaultShape() const { return !ClipEdited; }
  595.     void setHasDefaultShape(bool val) { ClipEdited = !val; }
  596.     //
  597.     bool isAutoFrame() const { return isAutoText; }
  598.     void setIsAutoFrame(bool val) { isAutoText = val; }
  599.     //
  600.     bool keepAspectRatio() const { return AspectRatio; }
  601.     void setKeepAspectRatio(bool val) { AspectRatio = val; }
  602.     //
  603.     bool fitImageToFrame() const { return !ScaleType; }
  604.     void setFitImageToFrame(bool val) { ScaleType = !val; }
  605.     
  606.     //Text Data - Move to PageItem_TextFrame at some point? --- no, to FrameStyle, av
  607.     double textToFrameDistLeft() const { return Extra; }
  608.     double textToFrameDistRight() const { return RExtra; }
  609.     double textToFrameDistTop() const { return TExtra; }
  610.     double textToFrameDistBottom() const { return BExtra; }
  611.     int columns() const { return Cols; }
  612.     double columnGap() const { return ColGap; }
  613.     double gridOffset() const;
  614.     double gridDistance() const;
  615.     void setTextToFrameDistLeft(double);
  616.     void setTextToFrameDistRight(double);
  617.     void setTextToFrameDistTop(double);
  618.     void setTextToFrameDistBottom(double);
  619.     void setColumns(int);
  620.     void setColumnGap(double);
  621.     void setGridOffset(double);
  622.     void setGridDistance(double);
  623.     FirstLineOffsetPolicy firstLineOffset()const;
  624.     void setFirstLineOffset(FirstLineOffsetPolicy);
  625.     /**
  626.      * \brief Set the text to frame distances all at once
  627.      * @param newLeft left distance
  628.      * @param newRight right distance
  629.      * @param newTop top distance
  630.      * @param newBottom bottom distance
  631.      */
  632.     void setTextToFrameDist(double newLeft, double newRight, double newTop, double newBottom);
  633.  
  634.     /**  @brief Get name of the item
  635.      *
  636.      * This is unrelated to QObject::name(); the pageItem's name is independent
  637.      * of its Qt name.
  638.      * See also PageItem::setItemName()
  639.      */
  640.     QString itemName() const { return AnName; }
  641.     /**
  642.      * @brief Set name of the item
  643.      * @param newName name for the item
  644.      * @author Riku Leino
  645.      *
  646.      * Note that this is unrelated to QObject::setName()
  647.      * See also PageItem::itemName()
  648.      */
  649.     void setItemName(const QString& newName);
  650.  
  651.     /** @brief Get the name of the pattern of the object */
  652.     QString pattern() const { return patternVal; }
  653.  
  654.     /** @brief Get the pattern transformation matrix of the object */
  655.     void patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const;
  656.  
  657.     /**
  658.      * @brief Set the fill pattern of the object.
  659.      * @param newPattern fill pattern for the object
  660.      */
  661.     void setPattern(const QString &newPattern);
  662.     
  663.     /**
  664.      * @brief Set the fill pattern transformation of the object.
  665.      */
  666.     void setPatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
  667.  
  668.     /** @brief Get the (name of the) fill color of the object */
  669.     QString fillColor() const { return fillColorVal; }
  670.     /**
  671.      * @brief Set the fill color of the object.
  672.      * @param newColor fill color for the object
  673.      */
  674.     void setFillColor(const QString &newColor);
  675.  
  676.     /** @brief Get the shade of the fill color */
  677.     double fillShade() const { return fillShadeVal; }
  678.     /**
  679.      * @brief Set the fill color shade.
  680.      * @param newShade shade for the fill color
  681.      */
  682.     void setFillShade(double newShade);
  683.  
  684.     /** @brief Get the transparency of the fill color */
  685.     double fillTransparency() const { return fillTransparencyVal; }
  686.     /**
  687.      * @brief Set the transparency of the fill color.
  688.      * @param newTransparency transparency of the fill color
  689.      */
  690.     void setFillTransparency(double newTransparency);
  691.  
  692.     /** @brief Get the blendmode of the fill color */
  693.     int fillBlendmode() const { return fillBlendmodeVal; }
  694.     /**
  695.      * @brief Set the blendmode of the fill color.
  696.      * @param newBlendmode blendmode of the fill color
  697.      */
  698.     void setFillBlendmode(int newBlendmode);
  699.  
  700.     /** @brief Get the blendmode of the stroke color */
  701.     int lineBlendmode() const { return lineBlendmodeVal; }
  702.     /**
  703.      * @brief Set the blendmode of the stroke color.
  704.      * @param newBlendmode blendmode of the stroke color
  705.      */
  706.     void setLineBlendmode(int newBlendmode);
  707.  
  708.     /** @brief Get the line color of the object */
  709.     QString lineColor() const { return lineColorVal; }
  710.     /**
  711.      * @brief Set the line color of the object.
  712.      * @param newColor line color for the object
  713.      */
  714.     void setLineColor(const QString &newColor);
  715.  
  716.     /** @brief Get the line color shade */
  717.     double lineShade() const { return lineShadeVal; }
  718.     /**
  719.      * @brief Set the line color shade.
  720.      * @param newShade shade for the line color
  721.      */
  722.     void setLineShade(double newShade);
  723.  
  724.     /** @brief Get the line transparency */
  725.     double lineTransparency() const { return lineTransparencyVal; }
  726.     /**
  727.      * @brief Set the transparency of the line color.
  728.      * @param newTransparency transparency of the line color
  729.      */
  730.     void setLineTransparency(double newTransparency);
  731.  
  732.     /** @brief Set the QColor for the line */
  733.     void setLineQColor();
  734.     /** @brief Set the QColor for the fill */
  735.     void setFillQColor();
  736.  
  737.     /** @brief Get the style of line */
  738.     Qt::PenStyle lineStyle() const { return PLineArt; }
  739.     /**
  740.      * @brief Set the style of line.
  741.      * @param newStyle style of line
  742.      * @sa Qt::PenStyle
  743.      */
  744.     void setLineStyle(Qt::PenStyle newStyle);
  745.  
  746.     /** @brief Get the width of the line */
  747.     double lineWidth() const { return m_lineWidth; }
  748.     /**
  749.      * @brief Set the width of line
  750.      * @param newWidth width of line
  751.      */
  752.     void setLineWidth(double newWidth);
  753.  
  754.     /** @brief Get the end cap style of the line */
  755.     Qt::PenCapStyle lineEnd() const { return PLineEnd; }
  756.     /**
  757.      * @brief Set the end style of line
  758.      * @param newStyle end style of line
  759.      * @sa Qt::PenCapStyle
  760.      */
  761.     void setLineEnd(Qt::PenCapStyle newStyle);
  762.  
  763.     /** @brief Get the join style of multi-segment lines */
  764.     Qt::PenJoinStyle lineJoin() const { return PLineJoin; }
  765.     /**
  766.      * @brief Set the join style of line
  767.      * @param newStyle join style of line
  768.      * @sa Qt::PenJoinStyle
  769.      */
  770.     void setLineJoin(Qt::PenJoinStyle newStyle);
  771.  
  772.     /** @brief Get name of active custom line style */
  773.     QString customLineStyle() const { return NamedLStyle; }
  774.     /**
  775.      * @brief Set custom line style
  776.      * @param newStyle name of the custom style
  777.      */
  778.     void setCustomLineStyle(const QString& newStyle);
  779.  
  780.     /** @brief Get start arrow index
  781.      * @sa PageItem::endArrowIndex(), PageItem::setStartArrowIndex()
  782.      */
  783.     int startArrowIndex() const { return m_startArrowIndex; }
  784.     /**
  785.      * @brief Set start arrow index
  786.      * @param newIndex index for start arrow
  787.      */
  788.     void setStartArrowIndex(int newIndex);
  789.  
  790.     /** @brief Get end arrow index
  791.      * @sa PageItem::startArrowIndex(), PageItem::setEndArrowIndex()
  792.      */
  793.     int endArrowIndex() const { return m_endArrowIndex; }
  794.     /**
  795.      * @brief Set end arrow index
  796.      * @param newIndex index for end arrow
  797.      */
  798.     void setEndArrowIndex(int newIndex);
  799.  
  800.     /** @brief Is the image flipped horizontally? */
  801.     bool imageFlippedH() const { return m_ImageIsFlippedH; }
  802.     /** @brief Horizontally flip / unflip the image */
  803.     void setImageFlippedH(bool flipped);
  804.     /** @brief Flip an image horizontally. */
  805.     void flipImageH();
  806.  
  807.     /** @brief Is the image flipped vertically? */
  808.     bool imageFlippedV() const { return m_ImageIsFlippedV; }
  809.     /** @brief Vertically flip / unflip the image */
  810.     void setImageFlippedV(bool flipped);
  811.     /** @brief Flip an image vertically */
  812.     void flipImageV();
  813.  
  814.     /**
  815.      * @brief Set the image scaling mode.
  816.      * @param freeScale is the scaling free (not forced to frame size)
  817.      * @param keepRatio should the image's aspect ratio be respected
  818.      */
  819.     void setImageScalingMode(bool freeScale, bool keepRatio);
  820.  
  821.     /** @brief Lock or unlock this pageitem. */
  822.     void toggleLock();
  823.     /** @brief is the item locked ? */
  824.     bool locked() const { return m_Locked; }
  825.     /** @brief Lock or unlock this pageitem */
  826.     void setLocked(bool isLocked);
  827.  
  828.     /** @brief Toggle lock for resizing */
  829.     void toggleSizeLock();
  830.     /** @brief Is the item's size locked? */
  831.     bool sizeLocked() const { return m_SizeLocked; }
  832.     /** @brief set lock for resizing */
  833.     void setSizeLocked(bool isLocked);
  834.  
  835.     /**
  836.      * @brief Does text flow around this object and how
  837.      * @sa setTextFlowMode()
  838.      */
  839.     TextFlowMode textFlowMode() const { return textFlowModeVal; }
  840.  
  841.     /**
  842.      * @brief Changes the way text flows around this item
  843.      * @param mode true if text is wanted to flow around this object or false if not
  844.      * @sa textFlowMode()
  845.      */
  846.     void setTextFlowMode(TextFlowMode mode);
  847.  
  848.     /**
  849.      * @brief If text should flow around object frame
  850.      * @sa PageItem::setTextFlowMode()
  851.      */
  852.     bool textFlowAroundObject() const { return (textFlowModeVal != TextFlowDisabled); }
  853.  
  854.     /**
  855.      * @brief If text should flow around object frame
  856.      * @sa PageItem::setTextFlowMode()
  857.      */
  858.     bool textFlowUsesFrameShape() const { return (textFlowModeVal == TextFlowUsesFrameShape); }
  859.  
  860.     /**
  861.      * @brief If text should flow around bounding box
  862.      * @sa PageItem::setTextFlowMode()
  863.      */
  864.     bool textFlowUsesBoundingBox() const { return (textFlowModeVal == TextFlowUsesBoundingBox); }
  865.  
  866.     /**
  867.      * @brief If text should flow around contour line
  868.      * @sa PageItem::setTextFlowMode()
  869.      */
  870.     bool textFlowUsesContourLine() const { return (textFlowModeVal == TextFlowUsesContourLine); }
  871.  
  872.     /**
  873.      * @brief If text should flow around image clipping path
  874.      * @sa PageItem::setTextFlowMode()
  875.      */
  876.     bool textFlowUsesImageClipping() const { return (textFlowModeVal == TextFlowUsesImageClipping); }
  877.     
  878.     /**
  879.      * @brief To be called carefully because it eventually triggers a relayout of long text frames strings, but necesarily when you change the document.
  880.      * @param allItems While you generally want to check for items below, it can happen that you want to update full range of text frames (e.g. when shuffle items order). Default to false.
  881.      */
  882.     void checkTextFlowInteractions(bool allItems = false);
  883.     
  884.     /** @brief Get the frame type
  885.      *
  886.      * @attention The whole concept of frame types is due for some radical
  887.      *            re-working, so don't rely on this interface staying stable.
  888.      *            It's here as an interim step to eliminate direct member access
  889.      *            on PageItems.
  890.      */
  891.     ItemType itemType() const { return m_ItemType; }
  892.     /** @brief Get the subclass item type
  893.      *
  894.      * This function should be used everywhere, where a itemType is required, but
  895.      * no C++ type informations is available. e.g. when saving files, etc.
  896.      * It returns the same type as itemType() for the standard classes, but 
  897.      * subclasses override it.
  898.      */
  899.     virtual ItemType realItemType() const { return m_ItemType; }
  900.     /**
  901.      * @brief Convert this PageItem to PageItem type <code>newType</code>
  902.      * @param newType PageItem type for conversion
  903.      */
  904.     void convertTo(ItemType newType);
  905.  
  906.     /**
  907.     * Set the layer for the item
  908.     * @param layerId layer where this item is moved
  909.     */
  910.     void setLayer(int layerId);
  911.  
  912.     /**
  913.      * @brief Check the changes to the item and add undo actions for them.
  914.      * @param force Force the check. Do not care if mouse button or arrow key is down
  915.      * check anyway.
  916.      * @author Riku Leino
  917.      */
  918.     void checkChanges(bool force = false);
  919.     /**
  920.      * @name Store undo actions
  921.      * @brief Add an undo action to the undo guis
  922.      * @author Riku Leino
  923.      */
  924.     /*@{*/
  925.     void moveUndoAction();
  926.     void resizeUndoAction();
  927.     void rotateUndoAction();
  928.     void changeImageOffsetUndoAction();
  929.     void changeImageScaleUndoAction();
  930.     /*@}*/
  931.     /** @brief Required by the UndoObject */
  932.     void restore(UndoState *state, bool isUndo);
  933.  
  934.     void getNamedResources(ResourceCollection& lists) const;
  935.     void replaceNamedResources(ResourceCollection& newNames);
  936.  
  937.     /**
  938.      * @brief Return a variant of `originalName' that is guaranteed to be unique
  939.      *        in the same document as this PageItem.  If the passed name is not
  940.      *        in use it is returned unchanged.
  941.      * @author Craig Ringer
  942.      *
  943.      * Usually of the form 'Copy of [name]' or 'Copy of [name] (n)'
  944.      */
  945.     QString generateUniqueCopyName(const QString originalName) const;
  946.     /**
  947.      * @brief Is this item printed?
  948.      * @sa setPrintEnabled()
  949.      */
  950.     bool printEnabled() const { return m_PrintEnabled; }
  951.     /**
  952.      * @brief Tells if the frame is set to be printed or not
  953.      * @sa printable()
  954.      */
  955.     void setPrintEnabled(bool toPrint);
  956.     
  957.     /** @brief Toggle printable
  958.      * @sa setPrintable()
  959.      */
  960.     void togglePrintEnabled();
  961.     
  962.     /**
  963.      * @brief Tells if the frame is tagged or not
  964.      * @sa isTagged()
  965.      */
  966.     bool isTagged() const { return tagged; }
  967.     /**
  968.      * @brief Set the tagged member for use when deleting items, instead of reselecting them.
  969.      * @sa setTagged()
  970.      */
  971.     void setTagged(bool);
  972.  
  973.     /**
  974.      * @brief Load an image into an image frame, moved from ScribusView
  975.      * @return True if load succeeded
  976.      */
  977.     bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1, bool showMsg = false);
  978.     
  979.     
  980.     /**
  981.      * @brief Connect the item's signals to the GUI, primarily the Properties palette, also some to ScMW
  982.      * @return 
  983.      */
  984.     bool connectToGUI();
  985.     bool disconnectFromGUI();
  986.     /**
  987.      * @brief Emit the items properties to the GUI in one go
  988.      */
  989.     void emitAllToGUI();
  990.     
  991.     /**
  992.      * @brief Get the document that this item belongs to
  993.      */
  994.     ScribusDoc* doc() const { return m_Doc; }
  995.     
  996.     bool isAnnotation() const { return m_isAnnotation; }
  997.     void setIsAnnotation(bool);
  998.     void setAnnotation(const Annotation& ad);
  999.     Annotation& annotation() { return m_annotation; }
  1000.     const Annotation& annotation() const { return m_annotation; }
  1001.     
  1002.     bool imageShown() const { return PicArt; }
  1003.     void setImageShown(bool);
  1004.     
  1005.     void updateConstants();
  1006.     
  1007. protected:
  1008.  
  1009.     void drawLockedMarker(ScPainter *p);
  1010.     void drawArrow(ScPainter *p, QMatrix &arrowTrans, int arrowIndex);
  1011.     
  1012.     /** @brief Manages undostack and is where all undo actions/states are sent. */
  1013.     UndoManager * const undoManager;
  1014.     /**
  1015.      * @name Restore helper methods
  1016.      * Split the restore method for easier handling.
  1017.      * @author Riku Leino
  1018.      */
  1019.     /*@{*/
  1020.     void restoreMove(SimpleState *state, bool isUndo);
  1021.     void restoreResize(SimpleState *state, bool isUndo);
  1022.     void restoreRotate(SimpleState *state, bool isUndo);
  1023.     void restoreFill(SimpleState *state, bool isUndo);
  1024.     void restoreShade(SimpleState *state, bool isUndo);
  1025.     void restoreLineColor(SimpleState *state, bool isUndo);
  1026.     void restoreLineShade(SimpleState *state, bool isUndo);
  1027.     void restoreName(SimpleState *state, bool isUndo);
  1028.     void restoreFillTP(SimpleState *state, bool isUndo);
  1029.     void restoreLineTP(SimpleState *state, bool isUndo);
  1030.     void restoreLineStyle(SimpleState *state, bool isUndo);
  1031.     void restoreLineEnd(SimpleState *state, bool isUndo);
  1032.     void restoreLineJoin(SimpleState *state, bool isUndo);
  1033.     void restoreLineWidth(SimpleState *state, bool isUndo);
  1034.     void restoreCustomLineStyle(SimpleState *state, bool isUndo);
  1035.     void restoreArrow(SimpleState *state, bool isUndo, bool isStart);
  1036.  
  1037.     void restorePStyle(SimpleState *state, bool isUndo);
  1038.  
  1039.     void restoreType(SimpleState *state, bool isUndo);
  1040.     void restoreTextFlowing(SimpleState *state, bool isUndo);
  1041.     void restoreImageScaleType(SimpleState *state, bool isUndo);
  1042.     void restoreImageScaleChange(SimpleState *state, bool isUndo);
  1043.     void restoreImageOffsetChange(SimpleState *state, bool isUndo);
  1044.     void restorePoly(SimpleState *state, bool isUndo, bool isContour);
  1045.     void restoreContourLine(SimpleState *state, bool isUndo);
  1046.     void restoreShapeType(SimpleState *state, bool isUndo);
  1047.     void restoreLayer(SimpleState *state, bool isUndo);
  1048.     void restoreGetImage(SimpleState *state, bool isUndo);
  1049.     void restoreGroupsLastItem(SimpleState *state, bool isUndo);
  1050.  
  1051.     void restoreShapeContour(UndoState *state, bool isUndo);
  1052.     void restoreImageEffects(UndoState *state, bool isUndo);
  1053.     /*@}*/
  1054.  
  1055.     /**
  1056.      * @brief Returns true if the actions should be sent to the UndoManager.
  1057.      *
  1058.      * Checks the state of the arrow keys and mouse buttons. If a key or a
  1059.      * mouse button is down PageItem is under some action which should only be
  1060.      * stored after the action has been finished (to get a single undo action).
  1061.      * @return true if the actions should be sent to the UndoManager based on the
  1062.      * state of arrow keys and mouse buttons else returns false.
  1063.      */
  1064.     bool shouldCheck();
  1065.     /** @brief Clears the current selection and selects this PageItem. */
  1066.     void select();
  1067.  
  1068.     // Protected members
  1069.  
  1070.     /**
  1071.      * @brief Frame Type, eg line, text frame, etc.
  1072.      *
  1073.      * This will probably go away when pageitem is split into
  1074.      * subclasses.
  1075.      */
  1076.     ItemType m_ItemType;
  1077.  
  1078.     /**
  1079.      * @brief Item name. Unicode. User visible (outline, property palette, etc).
  1080.      * @todo This is Annotation Name.. not item name, needs splitting up.
  1081.      * @sa PageItem::itemName(), PageItem::setItemName()
  1082.      */
  1083.     QString AnName; 
  1084.  
  1085.     /**
  1086.      * @brief Fill pattern name
  1087.      * @sa PageItem::pattern(), PageItem::setPattern()
  1088.      */
  1089.     QString patternVal;
  1090.     /**
  1091.      * @brief Fill pattern transformation matrix
  1092.      */
  1093.     double patternScaleX;
  1094.     double patternScaleY;
  1095.     double patternOffsetX;
  1096.     double patternOffsetY;
  1097.     double patternRotation;
  1098.  
  1099.     /**
  1100.      * @brief Fill color name
  1101.      * @sa PageItem::fillColor(), PageItem::setFillColor()
  1102.      */
  1103.     QString fillColorVal;
  1104.  
  1105.     /**
  1106.      * @brief Line color name
  1107.      * @sa PageItem::lineColor(), PageItem::setLineColor()
  1108.      */
  1109.     QString lineColorVal;
  1110.  
  1111.     /**
  1112.      * @brief Line shade
  1113.      * @sa PageItem::lineShade, PageItem::setLineShade()
  1114.      */
  1115.     double lineShadeVal;
  1116.  
  1117.     /**
  1118.      * @brief Fill shade
  1119.      * @sa PageItem::fillShade, PageItem::setFillShade()
  1120.      */
  1121.     double fillShadeVal;
  1122.  
  1123.     /**
  1124.      * @brief Fill transparency
  1125.      * @sa PageItem::fillTransparency(), PageItem::setFillTransparency()
  1126.      */
  1127.     double fillTransparencyVal;
  1128.  
  1129.     /**
  1130.      * @brief Line stroke transparency.
  1131.      * @sa PageItem::lineTransparency(), PageItem::setLineTransparency()
  1132.      */
  1133.     double lineTransparencyVal;
  1134.  
  1135.     /**
  1136.      * @brief Fill transparency blendmode
  1137.      * @sa PageItem::fillBlendmode(), PageItem::setFillBlendmode()
  1138.      */
  1139.     int fillBlendmodeVal;
  1140.  
  1141.     /**
  1142.      * @brief Line stroke transparency blendmode.
  1143.      * @sa PageItem::lineBlendmode(), PageItem::setLineBlendmode()
  1144.      */
  1145.     int lineBlendmodeVal;
  1146.  
  1147.     /**
  1148.      * @brief Is the image in this image item flipped horizontally?
  1149.      * @sa PageItem::isImageFlippedH(), PageItem::setImageFlippedH(),
  1150.      *     PageItem::flipImageH(), PageItem::flippedV
  1151.      */
  1152.     bool m_ImageIsFlippedH;
  1153.  
  1154.     /**
  1155.      * @brief Is the image in this image item flipped vertically?
  1156.      * @sa PageItem::isImageFlippedV(), PageItem::setImageFlippedV(),
  1157.      *     PageItem::flipImageV(), PageItem::flippedH
  1158.      */
  1159.     bool m_ImageIsFlippedV;
  1160.  
  1161.     /**
  1162.      * @brief Is the item locked (cannot be moved, resized, etc)?
  1163.      * @sa PageItem::locked(), PageItem::setLocked(), PageItem::toggleLock()
  1164.      */
  1165.     bool m_Locked;
  1166.  
  1167.     /**
  1168.      * @brief Is the item's size locked?
  1169.      * @sa PageItem::sizeLocked(), PageItem::setSizeLocked(), PageItem::toggleSizeLock()
  1170.      */
  1171.     bool m_SizeLocked;
  1172.  
  1173.     /**
  1174.      * @brief Should text flow around the item
  1175.      * @sa PageItem::textFlowMode(), PateItem::setTextFlowMode()
  1176.      */
  1177.     TextFlowMode textFlowModeVal;
  1178.  
  1179.     /**
  1180.      * @brief Stores the attributes of the pageitem (NOT properties, the user defined ATTRIBUTES)
  1181.      * @sa
  1182.      */
  1183.     ObjAttrVector pageItemAttributes;
  1184.  
  1185.     /**
  1186.      * @brief Is this item set to be printed/exported
  1187.      * @sa PageItem::printable(), PageItem::setPrintable()
  1188.      */
  1189.     bool m_PrintEnabled;
  1190.     
  1191.     /**
  1192.      * @brief Is this item set to have an action done to it, eg deleted
  1193.      * @sa PageItem::isTagged(), PageItem::setTagged()
  1194.      */
  1195.     bool tagged;
  1196.     
  1197.     QColor fillQColor;
  1198.     QColor strokeQColor;
  1199.     
  1200.     /** X position on the page */
  1201.     double Xpos;
  1202.     /** Y position on the page */
  1203.     double Ypos;
  1204.     /** Width of the item */
  1205.     double Width;
  1206.     /** Height of the item */
  1207.     double Height;
  1208.     /** Rotation of the item */
  1209.     double Rot;
  1210.     /** Element selected? */
  1211.     bool Select;
  1212.     /** Scaling X Factor for images */
  1213.     double LocalScX;
  1214.     /** Scaling Y Factor for images*/
  1215.     double LocalScY;
  1216.     /** Image X Offset to frame */
  1217.     double LocalX;
  1218.     /** Image Y Offset to frame */
  1219.     double LocalY;
  1220.     /** If the frame is reversed */
  1221.     bool Reverse;
  1222.  
  1223.     int m_startArrowIndex;
  1224.     int m_endArrowIndex;
  1225.  
  1226. protected:
  1227.       /** Left, Top, Bottom, Right distances of text from the frame */
  1228.     double Extra;
  1229.     double TExtra;
  1230.     double BExtra;
  1231.     double RExtra;
  1232.     
  1233.     FirstLineOffsetPolicy firstLineOffsetP;
  1234.     
  1235. public:
  1236.     /** Radius of rounded corners */
  1237.     double RadRect;
  1238.     
  1239.     //Undo Data
  1240.     /** @brief Stores the old X-position for undo action. Is used to detect move actions.*/
  1241.     double oldXpos;
  1242.     /** @brief Stores the old Y-position for undo action. Is used to detect move actions. */
  1243.     double oldYpos;
  1244.     /** @brief Stores the old width for undo action. Is used to detect resize actions. */
  1245.     double oldWidth;
  1246.     /** @brief Stores the old height for undo action. Is used to detect resize actions. */
  1247.     double oldHeight;
  1248.     /** @brief Stores the old rotation value for undo action. Is used to detect rotation actions. */
  1249.     double oldRot;
  1250.     /** @brief Stores the old LocalScX value for undo action. Is used to detect image scale actions. */
  1251.     double oldLocalScX;
  1252.     /** @brief Stores the old LocalScY value for undo action. Is used to detect image scale actions. */
  1253.     double oldLocalScY;
  1254.     /** @brief Stores the old LocalX value for undo action. Is used to detect image offset actions. */
  1255.     double oldLocalX;
  1256.     /** @brief Stores the old LocalY value for undo action. Is used to detect image offset actions. */
  1257.     double oldLocalY;
  1258.     
  1259.     /** Document this item belongs to */
  1260.     ScribusDoc *m_Doc;
  1261.     
  1262.     /** Flags and data for PDF Annotations */
  1263.     bool m_isAnnotation;
  1264.     Annotation m_annotation;
  1265.     
  1266.     /** Darstellungsart Bild/Titel */
  1267.     bool PicArt;
  1268.     
  1269.      /** Line width */
  1270.     double m_lineWidth;
  1271.     double Oldm_lineWidth;
  1272.  
  1273.     /** Inline Image */
  1274.     bool isInlineImage;
  1275.     QTemporaryFile *tempImageFile;
  1276.     
  1277. signals:
  1278.     //Frame signals
  1279.     void myself(PageItem *);
  1280.     void frameType(int);   // not related to Frametype but to m_itemIype :-/
  1281.     void position(double, double); //X,Y
  1282.     void widthAndHeight(double, double); //W,H
  1283.     void rotation(double); //Degrees rotation    
  1284.     void colors(QString, QString, double, double); //lineColor, fillColor, lineShade, fillShade
  1285.     void gradientType(int); //Normal, horizontal, vertical, etc.
  1286.     void patternFill(QString, double, double, double, double, double);
  1287.     void gradientColorUpdate(double, double, double, double, double, double); //Cpal updatespecialgradient
  1288.     void transparency(double, double); //fillTransparency, lineTransparency
  1289.     void blendmode(int, int); //fillBlendmode, lineBlendmode
  1290.     void frameLocked(bool); //Frame lock
  1291.     void frameSizeLocked(bool); //Frame size lock
  1292.     void frameFlippedH(bool); //Frame flipped horizontally
  1293.     void frameFlippedV(bool); //Frame flipped vertically
  1294.     void printEnabled(bool); //Frame is set to print or not
  1295.     //Shape signals
  1296.     void columns(int, double); //Number, gap
  1297.     void cornerRadius(double); //Corner radius of the shape
  1298.     //Line signals
  1299.     void lineWidth(double);
  1300.     void lineStyleCapJoin(Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle);
  1301.     //Frame text signals
  1302.     void lineSpacing(double);
  1303.     void textKerning(double);
  1304.     void textStyle(int);
  1305.     void textFont(const QString&);
  1306.     void textSize(double);
  1307.     void textWidthScale(double);
  1308.     void textHeightScale(double);
  1309.     void textBaseLineOffset(double);
  1310.     void textOutline(double);
  1311.     void textShadow(double, double);
  1312.     void textUnderline(double, double);
  1313.     void textStrike(double, double);
  1314.     void textColor(QString, QString, double, double);
  1315.     void textFormatting(int);
  1316.     void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
  1317.     //FIXME: columns, grid ?
  1318.     //Frame image signals
  1319.     void imageOffsetScale(double, double, double, double);
  1320. };
  1321.  
  1322. Q_DECLARE_METATYPE(PageItem*);
  1323.  
  1324. #endif
  1325.